#include<stdio.h>
#include<stdlib.h>
#include<string.h>
struct stu
{
	int num;
	char name[10];


}s[2] = { {8,"sdf"},{4,"aeg"} };
int cmp_a(const void* a,const void* b)
{
	return *(int*)a - *(int*)b;

}
int cmp_b(const void* a, const void* b)
{
	return *(char*)a - *(char*)b;

}
int cmp_s_name(const void* a, const void* b)
{
	return strcmp(((struct stu*)a)->name, ((struct stu*)b)->name);

}
int main() {
	int a[] = { 1,9,5,7,2,6,3 },i;
	char b[] = { "cha"};
	
	
	qsort(a, sizeof(a)/ sizeof(a[0]), sizeof(a[0]), cmp_a);
	qsort(b, sizeof(b) / sizeof(b[0]), sizeof(b[0]), cmp_b);
	qsort(s, sizeof(s) / sizeof(s[0]), sizeof(s[0]), cmp_s_name);
		for (i = 0; i < sizeof(a) / sizeof(a[0]); i++)
			printf("%d\n", a[i]);
		for (i = 0; i < sizeof(b) / sizeof(b[0]); i++)
			printf("%c\n", b[i]);
		for (i = 0; i < sizeof(s) / sizeof(s[0]); i++)
			printf("%s\n",s[i].name);



}